<!DOCTYPE html>
<html lang='en'>

<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <script type='text/javascript' src='js/vue.js'></script>
</head>

<body>
    <div id='app'>
        {{msg}}
        <p v-aaa>qqqq</p>
    </div>

    <div id='app2'>
        {{msg}}
        <p v-aaa>qqqq</p>
    </div>

    <script type='text/javascript'>

        Vue.directive("aaa", {
            // inserted:function(qq){
            //     console.log(qq);

            // }

            inserted(qq) {
                console.log(qq, 888)
                qq.style.color = "red";
            }
        })

        var vm = new Vue({
            el: '#app',
            data: {
                msg: 'Hello Vue'
            }
        });

        var vm2 = new Vue({
            el: '#app2',
            data: {
                msg: 'Hello Vue'
            }
        });
    </script>
</body>

</html>